from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session
from typing import List

from app.db.session import get_db
from app.models.tag import Tag

router = APIRouter()

@router.get("/", response_model=List[dict])
def get_all_tags(db: Session = Depends(get_db)):
    tags = db.query(Tag).all()
    return [{"id": tag.id, "name": tag.name, "usage_count": tag.usage_count} for tag in tags] 